home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
- #
- # Upgrader pre-processing script for 2.X systems.
-
- set path = (/bin /usr/bin /etc /usr/etc /usr/ucb)
- unalias *
-
- if ($#argv != 2) then
- echo "Usage: PreProcess targroot sourceroot"
- exit 1
- endif
-
- set target = $argv[1]
- set source = $argv[2]
- set docleanup
-
- echo Preparing $target for upgrade...
-
- if (-f ${target}/usr/lib/NextStep/software_version) then
- set sourcevers = `head -1 ${target}/usr/lib/NextStep/software_version`
- else
- set sourcevers = `head -1 ${target}/private/adm/software_version`
- endif
-
- if ("$sourcevers" == "2.0") then
- set releasename = 2.0
- else if ("$sourcevers" == "2.2") then
- set releasename = 2.2
- else if ("$sourcevers" == "2.1J") then
- set releasename = 2.1J
- else if ("$sourcevers" == "2.2J") then
- set releasename = 2.2J
- else if ("$sourcevers" == "3.0 Pre-release1") then
- set releasename = PR1
- unset docleanup
- else if ("$sourcevers" == "3.0 Pre-release2") then
- set releasename = PR2
- unset docleanup
- else if ("$sourcevers" == "3.0") then
- set releasename = 3.0
- unset docleanup
- else if ("$sourcevers" == "3.0J") then
- set releasename = 3.0J
- unset docleanup
- else if ("$sourcevers" == "3.1J") then
- set releasename = 3.1J
- unset docleanup
- else if ("$sourcevers" == "3.1 Prerelease1") then
- set releasename = 3.1PR1
- unset docleanup
- else if ("$sourcevers" == "3.1") then
- set releasename = 3.1
- unset docleanup
- else if ("$sourcevers" == "3.2 Prerelease") then
- set releasename = 3.2PR
- unset docleanup
- else if ("$sourcevers" == "3.2") then
- set releasename = 3.2
- unset docleanup
- else if ("$sourcevers" == "3.2J") then
- set releasename = 3.2J
- unset docleanup
- else if ("$sourcevers" == "2.1") then
- if (-f ${target}/NextLibrary/References/Webster-Dictionary/CompactDictionary.nxbf) then
- set releasename = 2.1
- else if (-f ${target}/NextApps/WriteNow.app/rtf-wn) then
- set releasename = 2.1I
- if (-f ${target}/usr/lib/NextStep/Displays/NeXTdimension.psdrvr/NDserver) then
- set serversz = `wc -c ${target}/usr/lib/NextStep/Displays/NeXTdimension.psdrvr/NDserver | awk '{print $1}'`
- if ($serversz == 450560) then
- set releasename = 2.1ND1
- else if ($serversz == 376832) then
- set releasename = 2.1ND2
- endif
- endif
- else
- set releasename = 2.1RN
- endif
- else
- echo "This upgrade can't be used to upgrade Release ${sourcevers}."
- exit 1
- endif
-
- if (! $?docleanup) then
- # Pre-remove compressed languages to try and free up as much space as possible.
- foreach language (French German Italian Swedish Spanish English)
- set statusfile = ${target}/NextLibrary/Receipts/${language}.pkg/${language}.status
- if (-f $statusfile) then
- if (`/bin/cat $statusfile` == "compressed") then
- echo Removing files for ${language}, which was never used...
- /bin/rm -rf ${target}/NextLibrary/Receipts/${language}.pkg
- endif
- endif
- end
- echo "Upgrade preparation complete."
- exit 0
- endif
-
- echo -n "Relocating package receipts..."
- set nonomatch
-
- mkdirs ${target}/NextLibrary/Receipts
- chown root.wheel ${target}/NextLibrary/Receipts
- chmod 777 ${target}/NextLibrary/Receipts
- foreach subdir (Extended Standard ThirdParty)
- mv ${target}/NextLibrary/Packages/${subdir}/* ${target}/NextLibrary/Receipts >& /dev/null
- end
-
- # Remove old receipts for standard packages.
-
- rm -rf ${target}/NextAdmin/Updates_2.1
- rm -rf ${target}/NextAdmin/Updates_NeXTdimension
- rm -rf ${target}/NextLibrary/Receipts/Update_ND.pkg
- rm -rf ${target}/NextLibrary/Receipts/UpdateExtensions_ND.pkg
- rm -rf ${target}/NextLibrary/Receipts/Updates_NeXTdimension.pkg
- rm -rf ${target}/NextLibrary/Receipts/Update_2.1.pkg
- rm -rf ${target}/NextLibrary/Receipts/UpdateExtensions_2.1.pkg
- rm -rf ${target}/NextLibrary/Receipts/2.1_Literature.pkg
- rm -rf ${target}/NextLibrary/Receipts/2.1_Demonstrations.pkg
- rm -rf ${target}/NextLibrary/Receipts/2.1_Documentation.pkg
- rm -rf ${target}/NextLibrary/Receipts/2.1_Developer.pkg
- rm -rf ${target}/NextLibrary/Receipts/Literature.pkg
- rm -rf ${target}/NextLibrary/Receipts/Demonstrations.pkg
- rm -rf ${target}/NextLibrary/Receipts/Documentation.pkg
- rm -rf ${target}/NextLibrary/Receipts/Developer.pkg
- rm -rf ${target}/NextLibrary/Receipts/French.pkg
- rm -rf ${target}/NextLibrary/Receipts/German.pkg
- rm -rf ${target}/NextLibrary/Receipts/Spanish.pkg
- rm -rf ${target}/NextLibrary/Receipts/Italian.pkg
- rm -rf ${target}/NextLibrary/Receipts/Swedish.pkg
- rm -rf ${target}/NextLibrary/Receipts/2.2*.pkg
- rm -rf ${target}/NextLibrary/Receipts/Update_2.2a.pkg
-
- echo "done."
-
- # Re-configure /usr/template (J-version only)
- if (-d ${target}/usr/template/userE) then
- echo -n "Re-configuring ${target}/usr/template/user..."
- rm -rf ${target}/usr/template/user
- cp -rp ${target}/usr/template/userE ${target}/usr/template/user
- echo "done."
- endif
-
- echo -n "Installing bill of materials for Release ${sourcevers}..."
- cp ${source}/Upgrader.app/Default.upgrade/PriorReleases/${releasename}/BaseSystem.bom \
- ${target}/usr/lib/NextStep/BaseSystem.bom
- chown root.wheel ${target}/usr/lib/NextStep/BaseSystem.bom
- chmod 644 ${target}/usr/lib/NextStep/BaseSystem.bom
- echo "done."
-
- if (-d ${target}/NextLibrary/Literature/Shakespeare) then
- set literature
- else if (-f ${target}/NextLibrary/References/Webster-Dictionary/pictures/wimple.rtf) then
- set literature
- endif
- if (-f ${target}/NextLibrary/Documentation/Unix/ManPages/man3/ferror.3s) then
- set doc
- else if (-f ${target}/NextLibrary/Documentation/NextDev/NextStep/Reference/03_CFunctions/DPSFuncts.rtf) then
- set doc
- endif
- if (-f ${target}/NextDeveloper/Demos/Balancer.app/Sound2.snd) then
- set demos
- else if (-f ${target}/NextLibrary/Music/Scores/Throb.score) then
- set demos
- endif
- if (-f ${target}/usr/include/appkit/Scroller.h) then
- set developer
- else if (-f ${target}/NextDeveloper/Examples/ScreenSender/BitMoverSpeaker.m) then
- set developer
- endif
- if (-d ${target}/usr/lib/NextStep/Languages/German) then
- set german
- endif
- if (-d ${target}/usr/lib/NextStep/Languages/French) then
- set french
- endif
-
- if ($?literature || $?doc || $?demos || $?developer || $?german || $?french) then
- echo -n "Installing exension package receipts:"
- else
- echo "Upgrade preparation complete."
- exit 0
- endif
-
-
- if ($?literature) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/PriorReleases/${releasename}/Literature.pkg \
- ${target}/NextLibrary/Receipts/Literature.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/Literature.pkg
- echo -n " Literature"
- endif
- if ($?doc) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/PriorReleases/${releasename}/Documentation.pkg \
- ${target}/NextLibrary/Receipts/Documentation.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/Documentation.pkg
- echo -n " Documentation"
- endif
- if ($?demos) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/PriorReleases/${releasename}/Demonstrations.pkg \
- ${target}/NextLibrary/Receipts/Demonstrations.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/Demonstrations.pkg
- echo -n " Demonstrations"
- endif
- if ($?developer) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/PriorReleases/${releasename}/Developer.pkg \
- ${target}/NextLibrary/Receipts/Developer.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/Developer.pkg
- echo -n " Developer"
- endif
- if ($?french) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/OldLanguages/French.pkg \
- ${target}/NextLibrary/Receipts/French.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/French.pkg
- echo -n " French"
- endif
- if ($?german) then
- rcp -rp ${source}/Upgrader.app/Default.upgrade/OldLanguages/German.pkg \
- ${target}/NextLibrary/Receipts/German.pkg
- chown -R root.wheel ${target}/NextLibrary/Receipts/German.pkg
- echo -n " German"
- endif
-
- echo "."
- echo "Upgrade preparation complete."
-
- exit 0
-